<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<%@ include file="header.jsp" %>

<link href="<%=contextPath%>/static/login.css" rel="stylesheet" />

<body class="login-layout"  style="background-color: #428BCA;">
<div class="main-content">
<div class="row">
	<div class="main">
	<div class='logo'>金融信息查询系统</div>
	<!-- <div class="caption2">我们关注您的用户体验，拒绝使用非现代浏览器。</div> -->
	
	<div class="col-sm-10 col-sm-offset-2">
		<div class="login-container">
			<div class="center">
				<h1>
					<!-- <i class="icon-leaf green"></i> -->
					<!-- <span class="red">Ace</span> -->
					<span class="white" style="font-style:italic">欢迎您</span>
				</h1>
				<!-- <h4 class="white">&copy; Company Name</h4> -->
				<!-- <h1 class="white">金融机构信息查询系统</h4> -->
			</div>

			<div class="space-6"></div>

			<div class="position-relative">
				<div id="login-box" class="login-box visible widget-box no-border">
					<div class="widget-body">
						<div class="widget-main">
							<h4 class="header blue lighter bigger">
								<i class="icon-coffee green"></i>
								请输入您的帐号
							</h4>

							<div class="space-6"></div>

							<form>
								<fieldset>
									<label class="block clearfix">
										<span class="block input-icon input-icon-right">
											<input id="username" name="username" type="text" class="form-control" placeholder="用户名" />
											<i class="icon-user"></i>
										</span>
									</label>

									<label class="block clearfix">
										<span class="block input-icon input-icon-right">
											<input id="password" name="password" type="password" class="form-control" placeholder="密码" />
											<i class="icon-lock"></i>
										</span>
									</label>

									<div class="space"></div>

									<div class="clearfix">
										<!-- <label class="inline">
											<input type="checkbox" class="ace" />
											<span class="lbl"> Remember Me</span>
										</label> -->

										<button type="button" class="width-30 pull-left btn btn-sm btn-primary" onclick="login()">
											<i class="icon-key"></i>
											登陆
										</button>
										
										<button type="button" class="width-30 pull-right btn btn-sm btn-danger" onclick="reset()">
											<i class="icon-key"></i>
											重置
										</button>
										
										
									</div>

									<div class="space-4"></div>
								</fieldset>
							</form>
						</div>
					</div><!-- /widget-body -->
				</div><!-- /signup-box -->
			</div><!-- /position-relative -->
		</div>
	</div><!-- /.col -->
</div>
</div><!-- /.row -->
</div>

<!-- inline scripts related to this page -->
<script type="text/javascript">

// 登录处理过程
function login() {
	var username = $("#username").val();
	var password = $("#password").val();
	var form = {};
	form.username = username;
	form.password = password;
	//alert(JSON.stringify(form));
	$.post("<%=contextPath%>/login.do", form, function(result, status) {
		if (result.success) {
			window.location = "<%=contextPath%>/index.do";
		} else {
			alert(result.error);
		}
	}, "json");
}

function reset() {
	$("#username").val("");
	$("#password").val("");
}

// 登录与后台的实际操作过程
function doSubmit() {
	var username = $("#username").val();
	var password = $("#password").val();
	var form = {};
	form.username = username;
	form.password = password;
	$.post("<%=contextPath%>/login.do", form, function(data) {
		return data;
	}, "post");
/* 	var result = {};
	// add access check process, here just return true
	result.success = true;
	
	return result; */
}

</script>
</body>
</html>